require('./PageAchievements.styl');
const GirdView = require('components/girdview');
const Panel = require('components/panel');
const Menu = require('components/menu');
const ui = require('clientConfig/util/jsapi/ui');
var paths = [{ path: "achievements", title: "成果管理", id: 'index0', tabTitles: "成果审批 系统管理" }];
class Achievements extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        };
        // {
        //     content: '招标成果',
        //     icon: "achievements/tender.svg",
        //     path: "/home/achievements/tenderachievement"
        // },
        this.action = [
            {
                content: '源代码',
                icon: "pay/software.svg",
                path: "/home/achievements/achievementmanage"
            }, {
                content: '可执行文件',
                icon: "achievements/execute.svg",
                path: "/home/achievements/achievementmanage"
            }, {
                content: '支持环境文件',
                icon: "achievements/environment_support.svg",
                path: "/home/achievements/achievementmanage"
            }, {
                content: '安装部署文件',
                icon: "achievements/installation.svg",
                path: "/home/achievements/achievementmanage"
            },
            {
                content: '日常成果文件',
                icon: "achievements/daily_results.svg",
                path: "/home/achievements/achievementmanage"
            },
            {
                content: '节点成果文件',
                icon: "achievements/node_results.svg",
                path: "/home/achievements/achievementmanage"
            }
        ];
        this.handlePlusClick = this.handlePlusClick.bind(this);
    }

    handlePlusClick() {
        this.setState({
            show: true,
        })
    }
    render() {
        let girdItems = [{ title: "待我审批的", hashPath: "/home/achievements/pending", src: "pending", homesvg: 'workplan0_svg1' }, { title: "我发起的", hashPath: "/home/achievements/sponsored", src: "sponsored", homesvg: "workplan0_svg2" }, { title: "抄送我的", hashPath: "/home/achievements/copy", src: "copy", homesvg: "workplan0_svg3" },
        { title: "变更申请", hashPath: "/home/achievements/changereq", src: "changereq", homesvg: "workplan0_svg4" }, { title: "变更记录", hashPath: "/home/achievements/changerecord", src: "changerecord", homesvg: "workplan0_svg5" }];
        let pro_girdItems = [{ title: "版本管理", hashPath: "/home/achievements/quality", src: "pending", homesvg: 'achievements1_svg1' }, { title: "质量管理", hashPath: "/home/achievements/quality", src: "sponsored", homesvg: "achievements1_svg2" }, { title: "进度跟踪", hashPath: "/home/achievements/quality", src: "sponsored", homesvg: "achievements1_svg3" }];
        return (
            <div className="achievements">
                {paths.map((item, index) => {
                    const ContentSvg = require(`images/svg/mangement/${item.path}.svg`);
                    return (<Panel title={item.title} Key={item.path} active tabTitles={item.tabTitles} cbPlus={this.handlePlusClick}>
                        <ContentSvg className="content-svg" />
                        <GirdView girdItems={girdItems} path={item.path} />
                        <GirdView girdItems={pro_girdItems} path={item.path} />
                    </Panel>);
                })
                }
                <Menu item={this.action} show={this.state.show} />
            </div>
        );
    }

    componentWillMount() {
        ui.setTitle({ title: "IT项目管理信息系统" });
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Achievements;
